﻿#define _CRT_SECURE_NO_WARNINGS
#include <type_traits>
#include <cstddef>
#include<iostream>
using namespace std;
// 1、类型检查
template<typename T>
void process(T value) {
	static_assert(std::is_integral<T>::value, "T must be an integral type");
	// 函数实现...
} 
// 2、编译时常量验证
constexpr int buffer_size = 1024;
// 3、平台或架构检查
static_assert(sizeof(void*) == 8, "This code requires 64-bit platform");
// 4、类型⼤⼩验证
static_assert(sizeof(int) == 4, "int must be 4 bytes");
int	main()
{
	process(1);
	static_assert(buffer_size > 0, "Buffer size must be positive");
	static_assert(buffer_size % 4 == 0, "Buffer size must be divisible by 4");
	static_assert(sizeof(void*) == 8, "This code requires 64-bit platform");
	static_assert(sizeof(int) == 4, "int must be 4 bytes");
	return 0;
}